-- GENERATED SPELL FOR [Coilfang Ambusher] --


function spell0_21865(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(37770,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21865', 520, 1)
end

function spell1_21865(pUnit, Event) --@Spread Shot,n/a--
pUnit:FullCastSpellOnTarget(37790,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21865', 2000, 1)
end

function Sorts_21865(pUnit, Event)
local choix_sorts_21865 = math.random(0, 1)
if choix_sorts_21865 == 0 then
pUnit:RegisterEvent('spell0_21865', 1, 1)
end
if choix_sorts_21865 == 1 then
pUnit:RegisterEvent('spell1_21865', 1, 1)
end
end

function mob21865_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21865', math.random(1500, 3000), 1)
end

function mob21865_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21865_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21865_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21865, 1, 'mob21865_Action')
RegisterUnitEvent(21865, 2, 'mob21865_Leave')
RegisterUnitEvent(21865, 3, 'mob21865_Kill')
RegisterUnitEvent(21865, 4, 'mob21865_Die')
